Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 0e79c3299ca503fb2f2888b85f681b4e257389f8


Parents : c61da06
Author : Mark Qvist <mark@unsigned.io>
Date : 2024-10-06T11:25:08+02:00

Added opportunistic delivery if destination ratchets are available

Changes

1 files changed, 4 insertions(+), 0 deletions(-)


Diff

diff --git a/nomadnet/Conversation.py b/nomadnet/Conversation.py
index 7487c87..9b3f804 100644
--- a/nomadnet/Conversation.py
+++ b/nomadnet/Conversation.py
@@ -216,6 +216,10 @@ class Conversation:
if self.app.directory.preferred_delivery(dest.hash) == DirectoryEntry.PROPAGATED:
if self.app.message_router.get_outbound_propagation_node() != None:
desired_method = LXMF.LXMessage.PROPAGATED
+ else:
+ if not self.app.message_router.delivery_link_available(dest.hash) and RNS.Identity.current_ratchet_id(dest.hash) != None:
+ RNS.log(f"Have ratchet for {RNS.prettyhexrep(dest.hash)}, requesting opportunistic delivery of message", RNS.LOG_DEBUG)
+ desired_method = LXMF.LXMessage.OPPORTUNISTIC
dest_is_trusted = False
if self.app.directory.trust_level(dest.hash) == DirectoryEntry.TRUSTED:


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────